<?php
/* @var $this UserController */
/* @var $model User */

$this->breadcrumbs=array(
    'Users'=>array('index'), 
    'Send'
);

   $this->menu=array(
    array('label'=>'用户列表', 'url'=>array('list')), 
  ); 

   Yii::app()->clientScript->registerCoreScript('jquery');
?>
<script type="text/javascript">
   $(document).ready(function(){
          var meslen=$('#sendmessage').val().length; 
          $("#shownum").html(meslen);
          $("#showItem").html(Math.ceil(meslen/50));


        $("#sendmessage").focus(function(){
           $('#showmessage').html(''); 
        });
        $('#sendmessage').live('keyup',function(){
            var meslen=$('#sendmessage').val().length; 
            $("#shownum").html(meslen);
            $("#showItem").html(Math.ceil(meslen/50));
        });
    });
</script>
<h1>发送手机短信</h1>

<div class="Action">
    <a href="<?php echo Yii::app()->request->urlReferrer; ?>"><img src="<?php echo Yii::app()->request->baseUrl; ?>/images/admin/jiantou.png" style=""></a>
</div>

 <div class="form">
  <p style="text-align: left;padding-left: 16%;line-height: 20px;">
    温馨提醒：<br/>
    1、发送内容不要带有<span style="color: red;">营销</span>性质语言,语句。运营商会屏蔽,但会扣费。<br/>
    2、发送内容长度50个(包含文字,标点,特殊字符)为一条短信。<br/> 
    3、每条短信后会默认加上红色部分<span style="color: red;">【****】</span>(*代表您的企业名),也包含在短信内。<br/> 
  </p>
<div id="showmessage" style="color: red;"><?php echo empty($model['errormessage'])?"":$model['errormessage'];?></div>

<?php $form=$this->beginWidget('CActiveForm', array(
    'id'=>'send-form',
    'enableAjaxValidation'=>false,
)); ?>
 
      
    <div class="row">
        <?php echo CHtml::hiddenField('selectids',$model['selectids']); ?>
        <?php echo CHtml::hiddenField('callback',$model['callback']); ?>
    </div>

    <div class="row">
        <?php echo CHtml::label("发送用户",false);?>
        <?php echo "<span class='mobiles'>".$model['mobiles']."</span>"; ?> 
    </div>  

    <div class="row">
        <?php echo CHtml::label("手机短信内容",false,array('required'=>true));?>
        <?php echo CHtml::textArea('sendmessage',empty($model["sendmessage"])?"":$model["sendmessage"],array('rows'=>6, 'cols'=>50,'id'=>'sendmessage','style'=>'line-height:16px;')); ?> 
    </div> 

     <div class="row">
        <?php echo CHtml::label("&nbsp;",false); ?>
        <span id="showLen">共输入【<span id="shownum">0</span>】字　　被拆分【<span id="showItem">0</span>】条</span>
    </div>
 

    <div class="row buttons">
        <?php echo CHtml::submitButton('发送手机短信',array('class'=>'subButton')); ?>
    </div>

<?php $this->endWidget(); ?>

</div><!-- form -->

 
